package com.bwie.controller;

import com.bwie.pojo.TbGroupJoin;
import com.bwie.service.TbGroupJoinService;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/product/index")
public class JoinController {
    @Autowired
    TbGroupJoinService tbGroupJoinService;


    @PostMapping("/getGroupJoinPage")
    public R getGroupJoinPage(@RequestBody PageInfoVo pageInfoVo){
        return tbGroupJoinService.getGroupJoinPage(pageInfoVo);
    }

    @PostMapping("/addGroupJoin")
    public R addGroupJoin(@RequestBody TbGroupJoin tbGroupJoin){
        return tbGroupJoinService.addGroupJoin(tbGroupJoin);
    }

    @PostMapping("/updateGroupJoin")
    public R updateGroupJoin(@RequestBody TbGroupJoin tbGroupJoin){
        return tbGroupJoinService.updateGroupJoin(tbGroupJoin);
    }


    @PostMapping("/deleteGroupJoin/{joinId}")
    public R deleteGroupJoin(@PathVariable("joinId") Integer joinId){
        return tbGroupJoinService.deleteGroupJoin(joinId);
    }
}
